<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        [v-once]{
            display: none;
        }
    </style>
</head>
<body>
<div id="app">
    <button @click="addBtn">这是输入框<input type="text"><button @click="addBtn">添加</button>
    <div class="trendsAdd"
    v-for="(item, index) in vif" :key="index">
        这是输入框<input type="text"><button @click="deleteBtn">删除</button>
    </div>

</div>
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data:{
            vif: [],
            a: ''
        },
        watch:{
            a(){
                if(this.vif.length>1){
                    console.log(this.vif.length)
                    return true;
                }else{
                    return;
                }
            }
        },
        methods:{
            addBtn(){
                this.vif.push({})
            },
            deleteBtn(index){
                this.vif.splice(index, 1)
            }
        }

    })
</script>
</body>
</html>